﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage/User.Master"
    CodeBehind="AdvertiseDashboard.aspx.vb" Inherits="GoodAnotApp.AdvertiseDashboard" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        #apContent
        {
            left: 50% !important;
            margin-left: -550px !important;
            width: 1100px !important;
        }
        .alert
        {
            padding: 8px 35px 8px 14px;
            margin-bottom: 18px;
            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
            background-color: #fcf8e3;
            border: 1px solid #fbeed5;
            -webkit-border-radius: 4px;
            -moz-border-radius: 4px;
            border-radius: 4px;
        }
        .alert, .alert-heading
        {
            color: #c09853;
        }
        .alert .close
        {
            position: relative;
            top: -5px;
            right: -21px;
            line-height: 18px;
        }
        .alert-success
        {
            background-color: #dff0d8;
            border-color: #d6e9c6;
        }
        .alert-success, .alert-success .alert-heading
        {
            color: #468847;
        }
        .alert-danger, .alert-error
        {
            background-color: #f2dede;
            border-color: #eed3d7;
        }
        .alert-danger, .alert-error, .alert-danger .alert-heading, .alert-error .alert-heading
        {
            color: #b94a48;
        }
        .alert-info
        {
            background-color: #d9edf7;
            border-color: #bce8f1;
        }
        .alert-info, .alert-info .alert-heading
        {
            color: #3a87ad;
        }
        
        .alert-block
        {
            padding-top: 14px;
            padding-bottom: 14px;
        }
        .alert-block > p, .alert-block > ul
        {
            margin-bottom: 0;
        }
        .alert-block p + p
        {
            margin-top: 5px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table style="width: 100%; margin-bottom: 0px">
        <tr>
            <td width="100%">
                <b style="color: #fe9901; font-size: 14pt">Advertisement Dashboard</b>
            </td>
        </tr>
        <tr>
            <td width="100%">
                <b style="color: #0099FF; font-size: 12pt">Search Engine Optimization</b>
            </td>
        </tr>
        <tr>
            <td style="border-top: 0px">
                <asp:ListView ID="lvConfirmSEO" runat="server" DataSourceID="SqlDataSourceSEOPayment">
                    <EmptyDataTemplate>
                        <div style="height: 200px; width: 1000px; background-color: White">
                            &nbsp;
                        </div>
                    </EmptyDataTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lblName" Visible="false" runat="server" Text='<%# Eval("name") %>' />
                        <asp:Label ID="lblStartDate" runat="server" Visible="false" Text='<%# Eval("start_date", "{0:dd/MM/yyyy}" ) %>' />
                        <asp:Label ID="lblEndDate" runat="server" Visible="false" Text='<%# Eval("end_date", "{0:dd/MM/yyyy}" ) %>' />
                        <asp:Label ID="lblDuration" runat="server" Visible="false" Text='<%# string.concat("<b>Duration : </b>",Eval("duration")) %>' />
                        <asp:Label ID="lbDurationOnly" runat="server" Visible="false" Text='<%# Eval("duration") %>' />
                        <asp:Label ID="lblStatus" runat="server" Visible="false" Text='<%# Eval("status") %>' />
                        <asp:Label ID="lblID" runat="server" Visible="false" Text='<%# Eval("adv_SEO_ID") %>' />
                        <asp:Label ID="lblOutletID" runat="server" Visible="false" Text='<%# Eval("outlet_ID") %>' />
                        <asp:Label ID="lblClicks" runat="server" Visible="false" Text='<%# Eval("clicks") %>' />
                        <asp:Label ID="lblImpressionsSeoHidden" runat="server" Visible="false" Text='<%# Eval("impressions") %>' />
                        <asp:Accordion ID="accSEO" runat="server" SelectedIndex="-1" RequireOpenedPane="false"
                            FadeTransitions="true" FramesPerSecond="40" TransitionDuration="250" OnInit="accSEOCreateControls"
                            OnItemCommand="lvConfirmSEO_ItemCommand">
                            <Panes>
                                <asp:AccordionPane ID="accSEOPane" runat="server">
                                    <Header>
                                        <div class="alert alert-info" id="divSEOHeader" style="background-color: #E0DEDE;
                                            border-color: #A4A4A4; color: Black; margin-bottom: 0px; margin-top: 18px" runat='server'>
                                            <table style="margin-bottom: 0px">
                                                <tr>
                                                    <td width="570px" style="margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;border-top:0px">
                                                        <asp:Label class="span2" ID="seoNameLabel" runat="server" Text='<%# Eval("name") %>' />
                                                    </td>
                                                    <td width="145px" style="margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;border-top:0px">
                                                        <asp:Label ID="lblImpressionsSEO" runat="server" Visible="false" Text="Label"></asp:Label>
                                                        <asp:Label class="span2" ID="seoStart_dateLabel" runat="server" Text='<%# Eval("start_date", "{0:dd/MM/yyyy}" ) %>' />
                                                    </td>
                                                    <td width="120px" style="margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;border-top:0px">
                                                        <asp:Label class="span2" ID="lblCost" runat="server" Text=""></asp:Label>
                                                        <asp:Label ID="lblClicksSEO" runat="server" Visible="false" Text="Label"></asp:Label>
                                                    </td>
                                                    <td width="155px" style="margin: 0px 0px 0px 0px; padding: 0px 0px 0px 10px;border-top:0px">
                                                        <b>Status: </b>
                                                        <asp:Label class="span2" ID="seoStatusLabel" runat="server" Text='<%# Eval("status") %>' />
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </Header>
                                    <Content>
                                        <div class="alert alert-info" style="margin-bottom: 5px; color: Black">
                                            <table style="margin-bottom: 0px">
                                                <asp:Panel ID="pnlSEOEdit" runat="server">
                                                    <tr>
                                                        <td colspan="2" style="border-top: 0px; padding-left: 700px; padding-top: 5px; padding-bottom: 5px">
                                                            <asp:LinkButton ID="lbCancelSEO" CausesValidation="false" CommandName="cancelEdit"
                                                                Visible="false" runat="server" Font-Size="Medium" class="close">Cancel </asp:LinkButton>
                                                            <asp:PlaceHolder ID="phDeleteSEO" runat="server"></asp:PlaceHolder>
                                                            <asp:LinkButton ID="lbEditSEO" runat="server" CommandName="editSEO" Font-Size="Medium"
                                                                Style="margin-right: 10px; margin-left: 190px" class="close">Edit</asp:LinkButton>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="435px" style="margin-top: 0px; border-top: 0px; padding: 0px 0px 0px 0px">
                                                            <b style="margin-bottom: 3px; margin-left: 20px">Duration &nbsp;&nbsp;: </b>
                                                            <asp:DropDownList ID="ddlSEODuration" Enabled="false" OnSelectedIndexChanged="ddlDurationSEOChange"
                                                                Style="margin-bottom: 3px" runat="server" Width="100px" AutoPostBack="True">
                                                                <asp:ListItem Value="1">1 Month</asp:ListItem>
                                                                <asp:ListItem Value="2">3 Months</asp:ListItem>
                                                                <asp:ListItem Value="3">6 Months</asp:ListItem>
                                                                <asp:ListItem Value="4">1 Year</asp:ListItem>
                                                            </asp:DropDownList>
                                                        </td>
                                                        <td width="565px" style="margin-top: 0px; border-top: 0px; padding: 0px 0px 0px 0px">
                                                            <b style="margin-bottom: 3px; margin-left: 20px">Link &nbsp;&nbsp;: </b>
                                                            <asp:HyperLink ID="hlSEOLink" runat="server" Enabled="true" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2" style="margin-top: 0px; border-top: 0px; padding: 0px 0px 0px 0px">
                                                            <b style="margin-bottom: 3px; margin-left: 20px">Start Date : </b>
                                                            <asp:PlaceHolder ID="phStartDateSEO" runat="server"></asp:PlaceHolder>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2" style="margin-top: 0px; border-top: 0px; padding: 0px 0px 0px 0px">
                                                            <b style="margin-bottom: 3px; margin-left: 20px">End Date &nbsp;:&nbsp;&nbsp; </b>
                                                            <asp:Label ID="lblEndDateSEOEdit" Enabled="false" runat="server" Text="Label"></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2" style="margin-top: 0px; border-top: 0px; padding: 0px 0px 0px 0px">
                                                            <b style="margin-bottom: 3px; margin-left: 20px">Cost&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;
                                                                $</b>
                                                            <asp:Label ID="lblCostSEOEdit" Enabled="false" runat="server" Text="Label"></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td style="border-top: 0px">
                                                        </td>
                                                        <td style="border-top: 0px">
                                                            <asp:LinkButton ID="lbConfirmEditSEO" Visible="false" CommandName="confirmEdit" runat="server"
                                                                Font-Size="Medium" class="close">Confirm </asp:LinkButton>
                                                        </td>
                                                    </tr>
                                                </asp:Panel>
                                            </table>
                                        </div>
                                    </Content>
                                </asp:AccordionPane>
                            </Panes>
                        </asp:Accordion>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <div id="itemPlaceholderContainer" runat="server" style="">
                            <span runat="server" id="itemPlaceholder" />
                        </div>
                        <div style="">
                        </div>
                    </LayoutTemplate>
                </asp:ListView>
                <asp:SqlDataSource ID="SqlDataSourceSEOPayment" runat="server" ConnectionString="<%$ ConnectionStrings:yijungoodAnotDBConnectionString %>"
                    SelectCommand="SELECT adv_SEO_ID, name, start_date,end_date, duration, status, outlet_ID, clicks, impressions FROM adv_SEO WHERE (user_ID = @userID)">
                    <SelectParameters>
                        <asp:Parameter Name="userID" DefaultValue="4" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td width="100%" style="padding-bottom: 0px">
                <b style="color: #0099FF; font-size: 12pt">Banner Advertising </b>
            </td>
        </tr>
        <tr>
            <td style="border-top: 0px">
                <asp:ListView ID="lvConfirmBanner" runat="server" DataSourceID="SqlDataSourceBanner">
                    <ItemTemplate>
                        <asp:Label class="span2" Visible="false" ID="lblOutletID" runat="server" Text='<%# Eval("outlet_ID") %>' />
                        <asp:Label class="span2" Visible="false" ID="lblID" runat="server" Text='<%# Eval("adv_image_ID") %>' />
                        <asp:Label class="span2" Visible="false" ID="lblImageName" runat="server" Text='<%# Eval("image_name") %>' />
                        <asp:Label class="span2" Visible="false" ID="lblStartDate" runat="server" Text='<%# Eval("start_date", "{0:dd/MM/yyyy}" ) %>' />
                        <asp:Label class="span2" Visible="false" ID="lblEndDate" runat="server" Text='<%# Eval("end_date", "{0:dd/MM/yyyy}" ) %>' />
                        <asp:Label class="span2" Visible="false" ID="lblCost" runat="server" Text='<%# string.concat("<b>Cost : </b>$", Eval("cost")) %>' />
                        <asp:Label class="span2" Visible="false" ID="lblCostOnly" runat="server" Text='<%# Eval("cost") %>' />
                        <asp:Label class="span2" Visible="false" ID="lblStatus" runat="server" Text='<%# Eval("status") %>' />
                        <asp:Label class="span2" Visible="false" ID="lblClicks" runat="server" Text='<%# Eval("clicks") %>' />
                        <asp:Label class="span2" Visible="false" ID="lblImpressions" runat="server" Text='<%# Eval("impressions") %>' />
                        <asp:Accordion ID="accBanner" runat="server" SelectedIndex="-1" RequireOpenedPane="false"
                            OnItemCommand="lvConfirmBanner_ItemCommand" FadeTransitions="true" FramesPerSecond="40"
                            TransitionDuration="250" OnInit="accBannerCreateControls">
                            <Panes>
                                <asp:AccordionPane ID="accBannerPane" runat="server">
                                    <Header>
                                        <div id="divHeader" class="alert alert-info" style="background-color: #E0DEDE; border-color: #A4A4A4;
                                            margin-bottom: 0px; margin-top: 18px; color: Black" runat="server">
                                            <table width="100%" style="margin-bottom: 0">
                                                <tr>
                                                    <td width="635px" style="margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; border-top: 0px">
                                                        <asp:Label class="span2" ID="nameLabel" runat="server" Text='<%# Eval("image_name") %>' />
                                                    </td>
                                                    <td width="155px" style="margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; border-top: 0px">
                                                        <asp:Label class="span2" Visible="false" ID="impressionsLabel" runat="server" Text='<%# Eval("impressions") %>' />
                                                        <asp:Label class="span2" ID="start_dateLabel" runat="server" Text='<%# string.concat("<b>Start Date :</b>",Eval("start_date", "{0:dd/MM/yyyy}" )) %>' />
                                                    </td>
                                                    <td width="130px" style="margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; border-top: 0px">
                                                        <asp:Label class="span2" Visible="false" ID="clicksLabel" runat="server" Text='<%# Eval("clicks") %>' />
                                                        <asp:Label class="span2" ID="costLabel" runat="server" Text='<%# string.concat("<b>Cost : </b>$", Eval("cost")) %>' />
                                                    </td>
                                                    <td width="170px" style="margin: 0px 0px 0px 0px; padding: 0px 0px 0px 10px; border-top: 0px">
                                                        <b>Status: </b>
                                                        <asp:Label class="span2" ID="statusLabel" runat="server" Text='<%# Eval("status") %>' />
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </Header>
                                    <Content>
                                        <div class="alert alert-info" style="margin-bottom: 0px; color: Black">
                                            <table style="margin-bottom: 0px">
                                                <asp:Panel ID="pnlInit" runat="server">
                                                    <tr>
                                                        <td style="border-top: 0px; padding-left: 700px; padding-top: 5px; padding-bottom: 5px">
                                                            <asp:LinkButton ID="lbCancelBanner" CommandName="cancelEdit" Visible="false" runat="server"
                                                                Font-Size="Medium" class="close" CausesValidation="false" Style="right: -160px !important">Cancel </asp:LinkButton>
                                                            <asp:LinkButton ID="lbDeleteBanner" CausesValidation="false" runat="server" CommandName="deleteBanner"
                                                                Font-Size="Medium" class="close">Delete </asp:LinkButton>
                                                            <asp:PlaceHolder runat="server" ID="phDeleteCbe" />
                                                            <asp:LinkButton ID="lbEditBanner" runat="server" CommandName="editBanner" Font-Size="Medium"
                                                                Style="margin-right: 10px" class="close">Edit</asp:LinkButton>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td style="padding: 2px 2px 2px 20px; margin: 2px 2px 2px 2px; border-top: 0px">
                                                            <asp:Panel ID="pnlEditNo" Style="margin-bottom: 25px" runat="server">
                                                                <asp:Image ID="imgPreview" Visible="false" runat="server" Width="970px" Height="280px"
                                                                    BorderColor="Black" BorderStyle="Solid" />
                                                            </asp:Panel>
                                                            <asp:Panel ID="pnlEditYes" Visible="false" runat="server">
                                                                <table style="margin-bottom: 0px">
                                                                    <tr>
                                                                        <td style="border-top: 0px" width="400px">
                                                                            <b style="margin-bottom: 3px">Duration &nbsp;&nbsp;: </b>
                                                                            <asp:DropDownList ID="ddlAccDuration" OnSelectedIndexChanged="ddlDurationBannerChange"
                                                                                Style="margin-bottom: 3px" runat="server" Width="100px" AutoPostBack="True">
                                                                                <asp:ListItem Value="1">1 Month</asp:ListItem>
                                                                                <asp:ListItem Value="2">3 Months</asp:ListItem>
                                                                                <asp:ListItem Value="3">6 Months</asp:ListItem>
                                                                                <asp:ListItem Value="4">1 Year</asp:ListItem>
                                                                            </asp:DropDownList>
                                                                            <br />
                                                                            <b>Start date : </b>
                                                                            <asp:PlaceHolder runat="server" ID="contentPanel" />
                                                                            <br />
                                                                            <b style="margin-bottom: 3px">End Date&nbsp; : </b>
                                                                            <asp:Label ID="lblEndDateBanner" Style="margin-bottom: 3px; margin-left: 6px" runat="server"
                                                                                Text=""></asp:Label>
                                                                            <br />
                                                                            <b>Cost &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: $</b>
                                                                            <asp:Label ID="lblCostBanner" runat="server" Text=""></asp:Label>
                                                                        </td>
                                                                        <td style="border-top: 0px">
                                                                            Upload new image *optional*
                                                                            <br />
                                                                            <span>
                                                                                <asp:FileUpload ID="FileUpload1" runat="server" />
                                                                                <asp:Button ID="btnUpload" class="btn" runat="server" Text="Upload" CommandName="upload"
                                                                                    Style="margin-left: 10px" /><br />
                                                                                <asp:Label ID="lblImgUploaded" runat="server" Text="Image uploaded" Visible="false"></asp:Label></span>
                                                                        </td>
                                                                        <td style="border-top: 0px">
                                                                            <asp:LinkButton ID="lbConfirmEditBanner" CommandName="confirmEdit" runat="server"
                                                                                Font-Size="Medium" class="close" Style="right: -170px !important; top: 75px">Confirm </asp:LinkButton>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </asp:Panel>
                                                        </td>
                                                    </tr>
                                                </asp:Panel>
                                                <asp:Panel ID="pnlEnabled" Visible="false" runat="server">
                                                    <tr>
                                                        <td style="border-top: 0px">
                                                            <asp:Label ID="lblStartDateEnabled" runat="server" Text="Label"></asp:Label>
                                                        </td>
                                                        <td style="border-top: 0px">
                                                            <b>End Date :</b>
                                                            <asp:Label ID="lblEndDateEnabled" runat="server" Text="Label"></asp:Label>
                                                        </td>
                                                    </tr>
                                                </asp:Panel>
                                            </table>
                                        </div>
                                    </Content>
                                </asp:AccordionPane>
                            </Panes>
                        </asp:Accordion>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <div runat="server" id="itemPlaceholder" />
                    </LayoutTemplate>
                </asp:ListView>
                <asp:SqlDataSource ID="SqlDataSourceBanner" runat="server" ConnectionString="<%$ ConnectionStrings:yijungoodAnotDBConnectionString %>"
                    SelectCommand="SELECT [adv_image_ID], [image_name], [start_date], [end_date], [status], [clicks], [impressions], [cost], [date_created], [outlet_ID] FROM [adv_image] WHERE ([user_ID] = @user_ID)">
                    <SelectParameters>
                        <asp:Parameter Name="user_ID" Type="Int32" DefaultValue="4" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
    </table>
    <asp:Button ID="btnMakePayment" runat="server" class="btn" Text="Payment" />
    <br />
    <br />
    <br />
    <br />
</asp:Content>
